﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NGUYENTHANHDONG.Excercise_lv2.Bai1
{
    class MODELS
    {
        public double Tinh(UserEntity objUser)
        {
            if(objUser.KIEU == 1)
            {
                return (objUser.SIDE1 + objUser.SIDE2 + objUser.SIDE3);
            }

            double p = (objUser.SIDE1 + objUser.SIDE2 + objUser.SIDE3) / 2;
            return Math.Sqrt(p * (p - objUser.SIDE1) * (p - objUser.SIDE2) * (p - objUser.SIDE3));
        }
    }
}
